from aip import AipFace

""" 你的 APPID AK SK """
APP_ID = '10334728'
API_KEY = 'RyXVZTuCcMelSYXOLN835q4H'
SECRET_KEY = '4yvoVLza2vvv5oKwDMjcsjYAcAxNj3P3'

client = AipFace(APP_ID, API_KEY, SECRET_KEY)

uid = "user1"

userInfo = "user's info"

groupId = "group1,group2"

""" 读取图片 """


def get_file_content(filePath):
    with open(filePath, 'rb') as fp:
        return fp.read()


image = get_file_content('kk.jpg')

""" 调用人脸注册 """
client.addUser(uid, userInfo, groupId, image);

""" 如果有可选参数 """
options = {}
options["action_type"] = "replace"

""" 带参数调用人脸注册 """
ret=client.addUser(uid, userInfo, groupId, image, options)

print(ret)
